<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>轮播</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.2/css/swiper.min.css">
    <style>
        .swiper-container {
            width: 600px;
            height: 300px;
        }  
    </style>

</head>
<body>
    <div class="swiper-container">
      <div class="swiper-wrapper">
        <div class="swiper-slide">slider1</div>
        <div class="swiper-slide">slider2</div>
        <div class="swiper-slide">slider3</div>
        <div class="swiper-slide">slider3</div>
        <div class="swiper-slide">slider3</div>
        <div class="swiper-slide">slider3</div>
        <div class="swiper-slide">slider3</div>
      </div>
    </div>

 

    <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.2/js/swiper.min.js"></script>
    <script>        
       var mySwiper = new Swiper('.swiper-container', {
          autoplay: true,//可选选项，自动滑动
          freeMode:true,//滑动不够一格，不会自动贴合
          slidesPerView:4,//设置slider容器能够同时显示的slides数量
      })

    </script>

</body>
</html>